// scaup - Scala up!
// (c) 2010, Normen Müller, normen.mueller@gmail.com  
// $Id: OS.scala 125 2010-09-16 13:48:09Z normen.mueller $
package scaup.io

/** @author <a href="mailto:normen.mueller@googlemail.com">Normen M\u00FCller</a>
 */
object OS {
  import scaup.Scaup._

  private val os = System.getProperty("os.name")

  lazy val isWindows = os != null && os.toLowerCase.indexOf("windows") >= 0

  lazy val isLinux = os != null && !isWindows && os.toLowerCase.indexOf("linux") >= 0

  lazy val isOSX = !isWindows && os != null && (os.toLowerCase.indexOf("mac") >= 0 || os.toLowerCase.indexOf("darwin") >= 0)

  lazy val is32Bit = "32".equals(System.getProperty("sun.arch.data.model", "32"))

  lazy val is64Bit = "64".equals(System.getProperty("sun.arch.data.model", "64"))

  lazy val TMP = System.getProperty("java.io.tmpdir").toFile

  lazy val HOME = System.getProperty("user.home").toFile
}
